package org.example.checkStore.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.example.checkStore.mapper.CheckWarehouseStoreDetailMapper;
import org.example.checkStore.domain.CheckWarehouseStoreDetail;
import org.example.checkStore.service.ICheckWarehouseStoreDetailService;
import com.ruoyi.common.core.text.Convert;

/**
 * 盘点仓库详情Service业务层处理
 *
 * @author 小孟微信：xiaomengcode
 * @date 2024-04-26
 */
@Service
public class CheckWarehouseStoreDetailServiceImpl implements ICheckWarehouseStoreDetailService
{
    @Autowired
    private CheckWarehouseStoreDetailMapper checkWarehouseStoreDetailMapper;

    /**
     * 查询盘点仓库详情
     *
     * @param checkWarehouseDetailId 盘点仓库详情主键
     * @return 盘点仓库详情
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public CheckWarehouseStoreDetail selectCheckWarehouseStoreDetailByCheckWarehouseDetailId(Long checkWarehouseDetailId)
    {
        return checkWarehouseStoreDetailMapper.selectCheckWarehouseStoreDetailByCheckWarehouseDetailId(checkWarehouseDetailId);
    }

    /**
     * 查询盘点仓库详情列表
     *
     * @param checkWarehouseStoreDetail 盘点仓库详情
     * @return 盘点仓库详情
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<CheckWarehouseStoreDetail> selectCheckWarehouseStoreDetailList(CheckWarehouseStoreDetail checkWarehouseStoreDetail)
    {
        return checkWarehouseStoreDetailMapper.selectCheckWarehouseStoreDetailList(checkWarehouseStoreDetail);
    }

    /**
     * 新增盘点仓库详情
     *
     * @param checkWarehouseStoreDetail 盘点仓库详情
     * @return 结果
     */
    @Override
    public int insertCheckWarehouseStoreDetail(CheckWarehouseStoreDetail checkWarehouseStoreDetail)
    {
        checkWarehouseStoreDetail.setCreateTime(DateUtils.getNowDate());
        return checkWarehouseStoreDetailMapper.insertCheckWarehouseStoreDetail(checkWarehouseStoreDetail);
    }

    /**
     * 修改盘点仓库详情
     *
     * @param checkWarehouseStoreDetail 盘点仓库详情
     * @return 结果
     */
    @Override
    public int updateCheckWarehouseStoreDetail(CheckWarehouseStoreDetail checkWarehouseStoreDetail)
    {
        return checkWarehouseStoreDetailMapper.updateCheckWarehouseStoreDetail(checkWarehouseStoreDetail);
    }

    /**
     * 批量删除盘点仓库详情
     *
     * @param checkWarehouseDetailIds 需要删除的盘点仓库详情主键
     * @return 结果
     */
    @Override
    public int deleteCheckWarehouseStoreDetailByCheckWarehouseDetailIds(String checkWarehouseDetailIds)
    {
        return checkWarehouseStoreDetailMapper.deleteCheckWarehouseStoreDetailByCheckWarehouseDetailIds(Convert.toStrArray(checkWarehouseDetailIds));
    }

    /**
     * 删除盘点仓库详情信息
     *
     * @param checkWarehouseDetailId 盘点仓库详情主键
     * @return 结果
     */
    @Override
    public int deleteCheckWarehouseStoreDetailByCheckWarehouseDetailId(Long checkWarehouseDetailId)
    {
        return checkWarehouseStoreDetailMapper.deleteCheckWarehouseStoreDetailByCheckWarehouseDetailId(checkWarehouseDetailId);
    }
}
